package 爬虫示例;



import java.io.IOException;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;

public class webpageJsoup {
    private static final String url = "http://www.cnblogs.com/luhan/p/5953387.html";
    
    public static void main(String[] args) {
        try {
            //获取整个网站的根节点，也就是html开头部分一直到结束
            Document document = Jsoup.connect(url).post();
           // System.out.println(document);
            Element a = document.getElementById("cb_post_title_url");
            Element blogTitle = document.getElementById("navList");
            System.out.println(blogTitle.text());
            Element fuBlogTitle = blogTitle.getElementById("blog_nav_sitehome");
            System.out.println(fuBlogTitle.text());
            System.out.println(a.text());
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
